/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSkyRoom.bridge.major;

import ru.jSkyRoom.interfaces.additional.Owner;
import ru.jSkyRoom.interfaces.major.EncounterZone;
import ru.jSkyRoom.interfaces.stub.GameLocation;
import skyproc.ECZN;
import skyproc.FormID;

/**
 *
 * @author Rakev
 */
public class EncounterZoneBridge extends MajorBridge<ECZN> implements EncounterZone {

    public EncounterZoneBridge(ECZN adapting) {
        super(adapting);
    }

    @Override
    public boolean getFlag(ECZN.ECZNFlags flag) {
        return getRawObject().get(flag);
    }

    @Override
    public void setFlag(ECZN.ECZNFlags flag) {
        getRawObject().set(flag, true);
    }

    @Override
    public void unsetFlag(ECZN.ECZNFlags flag) {
        getRawObject().set(flag, false);
    }

    @Override
    public GameLocation getLocation() {
        FormID id = getRawObject().getLocation();
        return getFinderFactory().createGameLocationFinder().find(id);
    }

    @Override
    public void setLocation(GameLocation location) {
        FormID id = getIdProducer().produce(location);
        getRawObject().setLocation(id);
    }

    @Override
    public int getMaxLevel() {
        return getRawObject().getMaxLevel();
    }

    @Override
    public void setMaxLevel(int maxLevel) {
        getRawObject().setMaxLevel(maxLevel);
    }

    @Override
    public int getMinLevel() {
        return getRawObject().getMinLevel();
    }

    @Override
    public void setMinLevel(int minLevel) {
        getRawObject().setMinLevel(minLevel);
    }

    @Override
    public Owner getOwner() {
        FormID id = getRawObject().getOwner();
        return (Owner) getFinderFactory().createMajorFinder().find(id);
    }

    @Override
    public void setOwner(Owner owner) {
        FormID id = getIdProducer().produce(owner);
        getRawObject().setOwner(id);
    }
}
